package com.njwb.common.json;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Schema(description = "响应结果实体类")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ResponseResult implements Serializable {
    @Schema(description = "响应码")
    private String responseCode;
    @Schema(description = "消息")
    private String message;
    @Schema(description = "数据")
    private Object data;//数据
    public static ResponseResult success(){
        return new ResponseResult("200","ok",null);
    }
    public static ResponseResult success(String message,Object returnObject){
        return new ResponseResult("200",message,returnObject);
    }
    public static ResponseResult success(String message){
        return new ResponseResult("200",message,null);
    }
    public static ResponseResult success(Object returnObject){
        return new ResponseResult("200","OK",returnObject);
    }
}